function Api() {
  //构造函数
  function Api() {
    return this;
  }

  // 测试地址
  Api.prototype.wxUrl = "https://md2-beta-wx.1miaodao.cn/wx/tenant/openid";
  Api.prototype.wxError = "https://md2-beta-wx.1miaodao.cn/wx/tenant/log/error";
  var url = "https://md2-beta-tenant.1miaodao.cn/wx";
  
  //正式地址
  //Api.prototype.wxUrl = "https://wx.1miaodao.cn/wx/tenant/openid";
  //Api.prototype.wxError = "https://wx.1miaodao.cn/wx/tenant/log/error";
  //var url = "https://sh.1miaodao.cn/wx";

  //var url = "http://192.168.1.4:8081/wx";
  //var url = "http://192.168.2.100:8081/wx"; //张衡
  //var url = "http://192.168.1.34:8081/wx" //李志伟

  // 获取短信验证码
  Api.prototype.authCode = url + "/user/anth/getAuthCode";
  // 用户认证(登录\绑定手机号)
  Api.prototype.login = url + "/a/anth/bindingMobile";
  // 获取个人及商家信息
  Api.prototype.getUserInfo = url + "/user/mng/getUserInfo";
  // 首页控件请求
  Api.prototype.getHomeFarem = url + "/applet/getHomeFarem23";
  // 获取商品分类
  Api.prototype.getProductGroup = url + "/wxconf/product/getProductGroup";
  // 商品列表
  //Api.prototype.getProductList = url + "/product/getProductList";
  Api.prototype.getProductList = url + "/product/getGoodsList";
  // 商品详情
  //Api.prototype.getProductDetails = url + "/product/getProductDetails";
  Api.prototype.getProductDetails = url + "/product/getGoodsDetails";
  // 购物车列表
  Api.prototype.getShoppingCartList = url + "/shop/product/getShoppingCartList";
  // 添加购物车
  Api.prototype.addShoppingCart = url + "/shop/product/addShoppingCart";
  // 删除购物车
  Api.prototype.delShoppingCart = url + "/shop/product/delShoppingCart";
  //修改购物车数量
  Api.prototype.modifyShoppingCar = url + "/shop/product/modifyShoppingCar";
  // 生成订单
  //Api.prototype.createOrder = url + "/user/order/createOrder1";
  Api.prototype.createOrder = url + "/user/order/createOrderTotal";
  // 全部订单
  //Api.prototype.getOrderList = url + "/user/order/getOrderList";
  Api.prototype.getOrderList = url + "/user/order/getOrderList23";
  // 取消订单
  Api.prototype.delOrder = url + "/user/order/delOrder";
  // 认确收货
  Api.prototype.endOrder = url + "/user/order/endOrder";
  // 更新订单
  //Api.prototype.modifyOrder = url + "/user/order/modifyOrder1";
  Api.prototype.modifyOrder = url + "/user/order/modifyOrder2";
  // 订单详情
  //Api.prototype.getOrderDetails = url + "/user/order/getOrderDetails";
  Api.prototype.getOrderDetails = url + "/user/order/getOrderDetails23";
  // 收货地址
  Api.prototype.getAddressList = url + "/user/user/getAddressList";
  // 编辑收货地址
  Api.prototype.modifyAddress = url + "/user/user/modifyAddress";
  // 删除收货地址
  Api.prototype.delAddress = url + "/user/user/delAddress";
  //请求默认收货地址
  Api.prototype.defualtAddress = url + "/user/defualtAddress";
  // 编辑个人资料
  Api.prototype.modifyUserInfo = url + "/user/user/modifyUserInfo";
  // 修改手机号
  Api.prototype.modifyMobile = url + "/user/user/modifyMobile";
  // 商家优惠券列表
  Api.prototype.getTenntCouponList = url + "/wxconf/coupon/getTenntCouponList";
  // 我的优惠券列表
  Api.prototype.getCouponList = url + "/wxconf/coupon/getCouponList";
  // 弹屏优惠券列表
  Api.prototype.getCoupon = url + "/wxconf/coupon/getCoupon";
  // 领取优惠券
  Api.prototype.receiveCoupon = url + "/wxconf/coupon/receiveCoupon";
  // 当前商品可使用优惠券
  Api.prototype.canUseCouponList = url + "/wxconf/coupon/canUseCouponList23";
  // 帐户支付
  Api.prototype.accountPay = url + "/user/pay/accountPay";
  // 微信支付
  //Api.prototype.wxPay = url + "/pay/pre";
  Api.prototype.wxPay = url + "/pay/preOne";
  // 帐户充值接口
  Api.prototype.recharge = url + "/user/recharge";
  //  微信充值接口
  Api.prototype.wxRecharge = url + '/pay/recharge';
  // 明细列表
  Api.prototype.getBills = url + "/user/user/getBills";
  // 单个明细
  Api.prototype.getBillDetails = url + "/user/user/getBillDetails";
  //绑定上级商户ID
  Api.prototype.bindUserFormQRcode = url + '/user/user/bindUserFormQRcode';
  //佣金收益
  Api.prototype.getProfitList = url + "/wxconf/distribution/getProfitList";
  //提现到帐记录
  Api.prototype.withdrawalsRecord = url + "/wxconf/distribution/withdrawalsRecord";
  // 注水
  Api.prototype.getSaleInfo = url + "/user/mng/getSaleInfo";
  //提交申请佣金提现
  Api.prototype.applyWithdrawals = url + "/wxconf/distribution/applyWithdrawals";
  //申请佣金列表
  Api.prototype.getCommissionRecord = url + "/wxconf/distribution/getCommissionRecord";
  //统计分享受
  Api.prototype.updateFxcs = url + "/user/updateFxcs";
  Api.prototype.upload = url + '/user/mng/upload';
  //售后
  //Api.prototype.orderReturn = url + '/user/orderReturn';
  Api.prototype.orderReturn = url + '/user/orderReturn23';
  //售后图片上传
  Api.prototype.orderload = url + '/user/orderload';
  //提交退货物流
  Api.prototype.orderReturnEx = url + '/user/orderReturnEx';
  //门店列表
  Api.prototype.storeList = url + '/wxconf/tenant/storeList';
  //门店详情
  Api.prototype.storeDetails = url + '/wxconf/tenant/storeDetails';
  //绑定微信的手机号
  Api.prototype.wxphone = url + '/user/mng/wxphone';
  //到店扫码
  //Api.prototype.end = url + '/user/order/end';
  Api.prototype.end = url + '/user/order/end23';
  //获取积分规则
  // Api.prototype.integralRule = url + '/wxconf/integral/integralRule';
  Api.prototype.integralRule = url + '/wxconf/integift/integralRule';
  //积分商品列表
  Api.prototype.integiftList = url + '/wxconf/integift/integralList';
  //积分商品详情
  Api.prototype.integralDetails = url + '/wxconf/integift/integralDetails';
  //积分明细
  Api.prototype.integralList = url + '/wxconf/integral/integralList';
  //积分详情
  //Api.prototype.integraldetail = url + '/wxconf/integral/integraldetail';
  // 获取拼团规则
  Api.prototype.groupRule = url + '/wxconf/group/groupRule';
  // 售后列表
  Api.prototype.getRefundOrderList = url + '/user/order/getRefundOrderList';
  // 售后详情
  Api.prototype.getRefundOrderDetail = url + '/user/order/getRefundOrderDetail';
  //拼团列表
  //Api.prototype.groupList = url + '/wxconf/group/groupList';
  Api.prototype.groupList = url + '/wxconf/group/getSpellGroupsList';
  //用户未开/参 团详情
  Api.prototype.SpellGroupDetail = url + '/wxconf/group/getSpellGroups';
  //商品已经开团
  Api.prototype.getSpellGroupsDetail = url + '/wxconf/group/getSpellGroupsDetail';
  //开团支付完成之后调用
  //Api.prototype.openSpellGroups = url + '/wxconf/group/openSpellGroups';
  //我的已开团/参团
  Api.prototype.mySpellGroups = url + '/wxconf/group/mySpellGroups';
  //我的已开团/参团详情
  Api.prototype.spellGroupsActiveDetail = url + '/wxconf/group/spellGroupsActiveDetail';
  // 文章列表
  Api.prototype.getAriticleList = url + '/article/getAriticleList';
  // 文章分类
  Api.prototype.getAriticleTypeList = url + '/article/getAriticleTypeList';
  // 文章详情
  Api.prototype.getArticleDetails = url + '/article/getArticleDetails';
  // 签到
  Api.prototype.signSendIntegral = url + '/wxconf/sign/signSendIntegral';
  // 签到状态
  Api.prototype.isSign = url + '/wxconf/sign/isSign';
  // 保存formId
  Api.prototype.saveFormId = url + '/user/mng/formId';
  // 发送优惠券通知
  Api.prototype.sendCoupn = url + '/wxconf/coupon/sendCoupn';
  // 查看物流详情
  Api.prototype.logistics = url + '/user/mng/logistics';


  return new Api();
}

module.exports = {
  Api: Api
}